<?php
// todo::链接数据库
$mysqli = @new mysqli("127.0.0.1", "root", "root", "school");
//判断是否正确
if($mysqli->connect_errno){
	exit('数据链接失败：'.$mysqli->connect_error);
}
// todo :: 告诉mysql 编码
$mysqli->query("set names utf8");

// $sql = "delete from stu where name like '%马%'";

// $res = $mysqli->query($sql);

// if(!$res){
// 	exit('执行失败：'.$mysqli->error);
// }


$sql = "select * from stu";

$res = $mysqli->query($sql);

$temp = [];

while ($row = $res->fetch_assoc()) {
	$temp[] = $row;
}


var_dump($temp);

// $mysqli->close();

// include './Db.class.php';

// $res = Db::query("select * from stu");

// var_dump($res);